package com.itany.corejava.day16;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.Socket;

public class TestClientA {

    public static void main(String[] args) {
        System.out.println("客户端");

        try(Socket s=new Socket("127.0.0.1",8888);
            BufferedReader br=new BufferedReader(
                    new InputStreamReader(
                            s.getInputStream()
                    )
            )){

            System.out.println("111111111111111111111111");
            //使当前线程进入阻塞状态，当读取到服务器段发送的一行数据时回到就绪状态
            String message=br.readLine();
            System.out.println("222222222222222222222222");

            System.out.println(message);

        }catch (Exception e){
            e.printStackTrace();
        }


    }


}
